//
//  AZURLRouter.h
//  AZURLRouter
//
//  Created by G-Xi0N on 2018/4/3.
//  Copyright © 2018年 gaoX. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>

@protocol AZURLRouterRedirectProtocol <NSObject>

- (void)redirectURL:(NSURL *)url completion:(void (^)(BOOL isRedirected, NSURL *redirectURL))completion;

@end

@interface AZURLRouter : NSObject

@property (nonatomic, copy, readonly) NSURL *baseURL;

@property (nonatomic, strong) id<AZURLRouterRedirectProtocol> redirector;

+ (instancetype)sharedURLRouter;

- (void)openURL:(NSURL *)url
     parameters:(NSDictionary *)parameters
           from:(UIViewController *)from
       animated:(BOOL)animated
  configuration:(void (^)(UIViewController *))configuration;

- (void)openURL:(NSURL *)url completionHandler:(void (^)(BOOL))completionHandler;

@end
